package cn.com.cfae.iras.doc.analyze.parse.model;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 有息债务
 */
public class YXZWModel extends BizBaseModel {

    /**
     * 有息债务
     */
    public static final String MODEL_NAME = "YXZW";


    /**
     * 借款余额
     */
    public static final String JKYE = "JKYE";
    /**
     * 借款日期
     */
    public static final String JKRQ = "JKRQ";
    /**
     * 到期日期
     */
    public static final String DQRQ = "DQRQ";
    /**
     * 借款期限
     */
    public static final String JKQX = "JKQX";
    /**
     * 借款起止日
     */
    public static final String JKQZR = "JKQZR";

    private static Map<String, String> items = new HashMap<>();

    static {
        items.put(JKYE, "借款余额|借款金额");
        items.put(JKRQ, "借款日期|借款日|起息时间|起息日");
        items.put(DQRQ, "到期日期|到期日|到期时间");
        items.put(JKQX, "借款期限|期限");
        items.put(JKQZR, "借款起止日|借款起始日|起止日期");
    }


    public static List<ExtractItem> createExtractItemList() {
        List<ExtractItem> extractItemList = new ArrayList<>();
        items.forEach((key, value) -> {
            ExtractItem extractItem = new ExtractItem();
            extractItem.setItemName(key);
            extractItem.setSynonyms(value.split(SYNONYM_SPLIT_CHAR));
            extractItemList.add(extractItem);
        });
        return extractItemList;
    }

}
